import http from './request'
export const host = 'http://localhost:3000'
/* 
  参数:对象    接口参数
  返回 promse对象
*/
export const handleDelete = (obj = {
  id: 0
}) => http({
  url: '/delstu',
  method: 'post',
  data: {
    ...obj
  }
})
export const xiugaiStu = (obj = {
  id: 0,
  name: '',
  age: ''
}) => http({
  url: '/delstu',
  method: 'post',
  data: {
    ...obj
  }
})
export const login = (obj = {
  user: '',
  pwd: ''
}) => http({
  url: '/login',
  method: 'post',
  data: {
    ...obj
  }
})

// 未来你们要学习一个东西  typescript  就是在干这一件事情  让我们的代码有提示

// interface xiugaicanshu {
//   id: Number,
//   name: String,
//   age: Number
// }

// export const xiugaiStudent = (stu: xiugaicanshu) => http({
//   url: '/delstu',
//   method: 'post',
//   data: {
//     ...obj
//   }
// })